<template>
  <div>
    <div class="ad-container"></div>
    <!-- <image src="https://wx.qolayapp.cn/static/images/swiper/ad.jpg"></image> -->
    <web-view :src="adURL"></web-view>
  </div>
</template>
<script>
export default {
  data() {
    return {
      adURL: ""
    };
  },
  mounted() {
    let { id, from } = this.$root.$mp.query;
    id = Number(id);
    if (from == "index") {
      let { indexAD } = wx.getStorageSync("config");
      this.adURL = indexAD[id].adURL;
    }
    if (from == "videoM") {
      let { middleAD } = wx.getStorageSync("config").videoAD;
      this.adURL = middleAD.adURL;
    }
    if (from == "videoTop") {
      let { topAD } = wx.getStorageSync("config").videoAD;
      this.adURL = topAD[id].adURL;
    }
    if (from == "videoDetail") {
      let { videoDetailAD } = wx.getStorageSync("config");
      this.adURL = topAD.adURL;
    }
    if (from == "moreVideo") {
      let { moreVideoAD } = wx.getStorageSync("config");
      this.adURL = moreVideoAD.adURL;
    }
    if (from == "template") {
      let { templateAD } = wx.getStorageSync("config");
      this.adURL = templateAD.adURL;
    }
  }
};
</script>
<style lang="scss">
.ad-container {
  width: 100%;
  height: 300rpx;
}
</style>
